#include <QObject>
#include <QSerialPort>
#include <QTimer>
#include <CommonHelper.h>
#include <StaticProperties.h>
#include <Experiment/ExperimentThread.h>

class DataSerialportClient : public QObject
{
    Q_OBJECT
public:
    explicit DataSerialportClient(QObject *parent = nullptr);

    void startAutoSend(int intervalMs = 2000,QString serialNamePort="");
    QThread thread;

private slots:
    void handleReadyRead();
    void sendMessage();

private:
    QSerialPort *serialPort;
    QTimer *timer;
    quint16 serverPort;
    bool messageStatus;
    QString message;
    QString info;
    QByteArray data;
};
